import userWalletApi from '@/api/user/wallet/index';

export default {
  actions: {
    userWalletAppointmentTransferByToken(context, data) {
      return userWalletApi.appointmentTransferByToken(data).then((data) => {
        let code = parseInt(data.code);
        if(code !== 0) { return {code:code,msg:data.msg}; }

        context.commit('setUserWallet', data.user_wallet);

        return {code:code,msg:data.msg};
      });
    }
  }
};
